/*
 * Radar410_data.h
 *
 *  Created on: May 22, 2020
 *      Author: SLX
 */

#ifndef _RADAR410_DATA_H_
#define _RADAR410_DATA_H_

#include "Platform_Types.h"

#define  RADAR_410_OBJ_MAX_NUM  40 

typedef struct
{
	    uint16 can_id;// 
		    uint16  tttttt ; //
    uint8  can_data[8];/**/
    uint8   test[8];/*水水水水*/
}RADAR_CAN_DATA_TYPE;

#ifndef DEFINED_TYPEDEF_FOR_RADAR_410_OBJ_TYPE_
#define DEFINED_TYPEDEF_FOR_RADAR_410_OBJ_TYPE_

typedef struct
{
    float objObstacleProb;
    float objXPos_Stdev;
    float objYPos_Stdev;
    float objXVelRel_Stdev;
    float objXAccRel;
    float objExstProb;
    float objYVelRel;
    float objXVelRel;
    float objXPos;
    float objYPos;
    uint8 objID;
    uint8 objUpdateFlag;
    uint8 objValidFlag;
    uint8 objMotionPattern;
    uint8 objType;
    uint8 objMeasFlag;
    uint8 padding[2];
}RADAR_410_OBJ_TYPE; // 48byte
#endif

#ifndef DEFINED_TYPEDEF_FOR_RADAR_410_STATUS_TYPE_
#define DEFINED_TYPEDEF_FOR_RADAR_410_STATUS_TYPE_

typedef struct
{
    uint8  obj_Latency;
    uint8  Status_Blockage;
    uint8  Radar_Working;
    uint8  Status_Msg_AliveCounter;
    uint8  Status_Msg_CheckSum;
	uint8  padding[3];
	uint32 TimeStamp;
    float  HostSpeed;
    float  HostYaw;
}RADAR_410_STATUS_TYPE;  //20 byte
#endif

#ifndef DEFINED_TYPEDEF_FOR_RADAR_410_INTERFACE_
#define DEFINED_TYPEDEF_FOR_RADAR_410_INTERFACE_

typedef struct
{
    uint8 num_obstacles_;
    uint8 padding[3];
    RADAR_410_STATUS_TYPE radar_status;
    RADAR_410_OBJ_TYPE obj_interface[RADAR_410_OBJ_MAX_NUM];
}RADAR_410_INTERFACE;
#endif

extern volatile boolean Radar410_Data_Pack_Complete;
//RADAR_410_INTERFACE Radar410_Data_Interface;

extern void Radar_410_CAN_Message_Data_Pack(uint16 can_id, uint8* src_addr);
extern void Radar_Conti410_Decode(void);

#endif
